feat(@angular/cli): add build defaults to config - #6889
Conversation
1237102 to
7806019
Compare
| `)); | ||
| } | ||
|
|
||
| this.addAliases(cliConfig); |
There was a problem hiding this comment.
I prefer referring to static methods via the class name and not this because this conveys an instance member and not a static method. (same thing other places).
|
|
||
| public getPaths(baseJsonPath: string, keys: string[]) { | ||
| const ret: { [k: string]: any } = {}; | ||
| keys.forEach(key => ret[key] = this.get(`${baseJsonPath}.${key}`)); |
There was a problem hiding this comment.
I think map makes more sense here
return keys.map(key => ({[key]: this.get(`${baseJsonPath}.${key}`)});
There was a problem hiding this comment.
Your code and his are not equivalent :)
return keys.reduce((acc, k) => {
acc[key] = this.get(`${baseJsonPath}.${key}`);
return acc;
}, {});might be more correct but more verbose.
There was a problem hiding this comment.
I actually spent a fair bit of time figure out what the best way to do this function was, I was torn between the reduce and forEach. The reduce also needs a typing for the accumulator:
return keys.reduce((acc, key) => {
acc[key] = this.get(`${baseJsonPath}.${key}`);
return acc;
}, {} as { [k: string]: any });
All the same to me though, I left the forEach for now but will change if there's a preference.
759eab6 to
67f7608
Compare
Adds following defaults to `.angular-cli.json` under `defaults`: `sourcemaps`, `baseHref`, `progress`, `poll`, `deleteOutputPath`, `preserveSymlinks`, `showCircularDependencies`. They can be set via `ng set defaults.build.KEY = VALUE`. Also removes `apps.0.showCircularDependencies`. This is not a breaking chance since it was only added in 1.3.0-beta.0. Followup to angular#6884 (comment).
67f7608 to
3fb0e67
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds following defaults to
.angular-cli.jsonunderdefaults:sourcemaps,baseHref,progress,poll,deleteOutputPath,preserveSymlinks,showCircularDependencies.They can be set via
ng set defaults.build.KEY = VALUE.Also removes
apps.0.showCircularDependencies. This is not a breaking chance since it was only added in 1.3.0-beta.0.Followup to #6884 (comment).